using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace Adoor
{
    public class AdoorLoger
    {

        private static TraceSwitch mySwitch = new TraceSwitch("General", "Entire Application");

        public static bool IsDebugEnabled
        {
            get { return mySwitch.TraceInfo; }
        }

        public static void Debug(string msg)
        {
            if (mySwitch.TraceInfo)
                Trace.TraceInformation(msg);
        }

        public static void Debug(string format, params object[] args)
        {
            if (mySwitch.TraceInfo)
                Trace.TraceInformation(format, args);
        }

        public static void Warning(string msg)
        {
            if (mySwitch.TraceWarning)
                Trace.TraceWarning(msg); 
        }

        public static void Warning(string format, params object[] args)
        {
            if (mySwitch.TraceWarning)
                Trace.TraceWarning(format,args);
        }

        #region error
        
        public static void Error(string msg)
        {
            if (mySwitch.TraceError)
                Trace.TraceError(msg);
        }

        public static void Error(string format, params object[] args)
        {
            if (mySwitch.TraceError)
                Trace.TraceError(format, args);
        }
#endregion
    }
}
